<template>
    <div class="lifecycle-container">
        <h1>Vue生命周期钩子函数学习</h1>
        <div class="welcome">
            <div>你好世界</div>
            <div>{{ xinxi }}</div>
        </div>
        
        <div class="nav-links">
            <router-link to="/beforeMount" class="nav-link">onBeforeMount</router-link>
            <router-link to="/mounted" class="nav-link">onMounted</router-link>
            <router-link to="/beforeUpdate" class="nav-link">onBeforeUpdate</router-link>
            <router-link to="/updated" class="nav-link">onUpdated</router-link>
            <router-link to="/beforeUnmount" class="nav-link">onBeforeUnmount</router-link>
            <router-link to="/unmounted" class="nav-link">onUnmounted</router-link>
        </div>
    </div>
</template>

<script>
export default {
   setup(props, context) {
    return {
        xinxi: "动物的世界"
    };
   }
}
</script>

<style scoped>
.lifecycle-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

h1 {
    color: #3498db;
    text-align: center;
    margin-bottom: 30px;
}

.welcome {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
    font-size: 18px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.nav-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: #2980b9;
}
</style>